
import { GraphNode } from "@/js/components/GraphNode"
import { GraphView } from "@/js/components/GraphView"
import { InputLinkNodeAny, InputLinkNodeBoolean, InputLinkNodeColor, InputLinkNodeFlow, InputLinkNodeGroup, InputLinkNodeNumber, InputLinkNodeString } from "@/js/components/InputLinkNode"

export class Export extends GraphNode{
    group?: InputLinkNodeGroup
    load(){
        super.load()

        const layout = new this.DefaultLayout(this, this.graphView as GraphView, true, false)
        this.layout = layout
        this.appendChild(layout.container)

        const group = new InputLinkNodeGroup( this, this.graphView as GraphView , {
            name: 'data'
        })
        layout.main?.left.appendChild(group)

        group.addInputLinkNode("字符串", InputLinkNodeString, {
            name: '',
            desc: '字符串',
            model: "entry",
            inputTypeString: true,
            placeholder: '导出名称',
            isBindValue: false
        })

        group.addInputLinkNode("数值", InputLinkNodeNumber, {
            name: '',
            desc: '数值',
            model: "entry",
            inputTypeString: true,
            placeholder: '导出名称',
            isBindValue: false
        })

        group.addInputLinkNode("布尔", InputLinkNodeBoolean, {
            name: '',
            desc: '布尔',
            model: "entry",
            inputTypeString: true,
            placeholder: '导出名称',
            isBindValue: false
        })

        group.addInputLinkNode("通用", InputLinkNodeAny, {
            name: '',
            desc: '通用',
            model: "entry",
            inputTypeString: true,
            placeholder: '导出名称',
            isBindValue: false
        })

        this.group = group
    }

    import(obj:any){
        this.group?.import(obj.userData.data)
        super.import(obj)
    }
}